package com.xyg.common.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 数据实体
 * @author lzn@1805887
 * @param <T>
 * @param <ID>
 */
@MappedSuperclass
@JsonAutoDetect(fieldVisibility = Visibility.NONE, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE, creatorVisibility = Visibility.NONE)
@EntityListeners(DataEntityListener.class)
public abstract class DataEntity<T,ID extends Serializable> extends BaseEntity<T, ID> {
	
	/**创建时间*/
	@JsonProperty
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	@Column(nullable = false, updatable = false)
	protected Date createDate;
	
	/**修改时间*/
	@JsonProperty
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	@Column(nullable = false, updatable = false)
	protected Date updateDate;
	
	/**备注*/
	protected String remarks;
	
	
	protected DataEntity(){
		super();
	}
	
	protected DataEntity(ID id) {
		super(id);
	}
	
	
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	
	

}
